javascript check if element has class

50

check if a class exists javascript -

const element = document.querySelector("#box");

element.classList.contains("active");

Comments

Submit
0 Comments